package com.itheima.service.impl;

import com.itheima.dao.TeachDao;
import com.itheima.service.TeachService;

/**
 * @Author 王加鑫
 * @Date 2021/7/21 21:53
 * @Since JDK 1.9
 */
public class TeachServiceImpl implements TeachService {

    private int age;
    private String course;
    private TeachDao dao;

    public TeachServiceImpl(int age, String course, TeachDao dao) {
        this.age = age;
        this.course = course;
        this.dao = dao;
    }

    @Override
    public void teach() {
        dao.teach();
        System.out.println("王老师已经教了" + age + "年" + course + "学科");
    }
}
